package com.drg.center.entity.param;

import com.guaike.core.entity.annotation.ConditionBy;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @Author: zhangxilin
 * @Date: 2024/5/21
 */
@Data
@ApiModel("添加资源信息DTO")
public class ResourcesAddDTO implements Serializable {

    @ApiModelProperty("资源名称")
    @NotBlank(message = "请填写资源名称")
    private String name;

    @ApiModelProperty("所属系统编号")
    @NotBlank(message = "所属系统编号不能为空")
    private String sysCode;

    @ApiModelProperty("资源标识(菜单为文件路径,按钮为权限码)")
    private String code;

    @ApiModelProperty("图标地址")
    private String icon;

    @ApiModelProperty("父节点ID")
    private Long pid;

    @ApiModelProperty("资源类型（0：菜单，1：按钮, 2: 目录）")
    @NotNull(message = "资源类型不能为空")
    private Integer resType;

    @ApiModelProperty("接口uri(按钮权限用)")
    private String uri;

    @ApiModelProperty("路由")
    @ConditionBy(column = "resType", columnValue = "0", message = "请输入路由地址")
    private String router;

    @ApiModelProperty("排序字段")
    private Integer sortIndex;

    @ApiModelProperty("备注")
    private String remark;

}
